<?php
$this->breadcrumbs=array(
	'Courses'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'Liệt kê lớp', 'url'=>array('index')),
	array('label'=>'Tạo lớp', 'url'=>array('create')),
	array('label'=>'Cập nhật lớp', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Xóa lớp', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Bạn có chắc không?')),
	array('label'=>'Quản lý lớp', 'url'=>array('admin'))
);
    if($model->status==0) 
        array_push($this->menu,array('label'=>'Tạo giấy giới thiệu', 'url'=>array('intropage/create','id_course'=>$model->id)));
//    } else {
//        array_push($this->menu,array('label'=>'Báo lỗi', 'url'=>array('intropage/noticeFail','id_course'=>$model->id)));
//    }
?>

<h1>Lớp mã số <?php echo $model->id; ?></h1>
<fieldset class="classFieldSet">
    <legend>Thông tin phụ huynh</legend>
    <table>
        <tr>
            <td class="titleInput"><?php echo "Phụ huynh"; ?></td>
            <td class="dataInput"><?php echo $model->parent_name; ?></td>
        </tr>
        <tr>
                <td class="titleInput">
                    <?php echo "Địa chỉ"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->home_number."-"; ?>
                    <?php echo $model->street."-"; ?>
                    <?php echo $model->district->name; ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Di động"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->cell_phone; ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "ĐT bàn"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->table_phone; ?>
                </td>
            </tr>
    </table>
</fieldset>
<!--        Thong tin hoc sinh-->
        <fieldset class="classFieldSet">
            <legend>Thông tin học sinh</legend>
            <table>
                <tr>
                <td class="titleInput">
                    <?php echo "Học sinh"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->student_name; ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Trình độ"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->level->name;?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Tên trường"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->school_name; ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Giới tính"; ?>
                </td>
                <td class="dataInput">
                    <?php 
                        if($model->sex == 1) {
                            echo "Nam";
                        } else {
                            echo "Nữ";
                        }
                    ;?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Học lực"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->ability;?>
                </td>
            </tr>
            </table>
</fieldset>
<fieldset class="classFieldSet">
            <legend>
                Thông tin yêu cầu
            </legend>
            <table>
                <tr>
                <td class="titleInput">
                    <?php echo "Yêu cầu giáo viên"; ?>
                </td>
                <td class="dataInput">
                    <?php
                        if($model->tutor_request == 0) {
                            echo "Sinh viên";
                        } else if($model->tutor_request == 1) {
                            echo "Giáo viên";
                        } else {
                            echo "Không yêu cầu";
                        }
                    ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Yêu cầu giới tính"; ?>
                </td>
                <td class="dataInput">
               
                    <?php
                        if($model->sex_request == 1) {
                            echo "Nam";
                        } else if($model->tutor_request == 0) {
                            echo "Nữ";
                        } else {
                            echo "Không yêu cầu";
                        }
                    ?>
                </td>
            </tr>

            <tr>
                <td class="titleInput">
                    <?php echo "Mức lương"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->salary.' VNĐ'; ?>
                </td>
            </tr>

             <tr>
                <td class="titleInput">
                    <?php echo CHtml::encode("Môn học"); ?>
                </td>
                <td class="dataInput">
                    <?php foreach ($model->subjects as $subject) {
                                echo '  '.CHtml::encode($subject->name);
                            }
                    ?>
                </td>
            </tr>
            <?php if($model->start_day != null) {?>
            <tr>
                <td class="titleInput">
                    <?php echo "Ngày bắt đầu"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->start_day;?>
                </td>
            </tr>
            <?php } ?>
            <?php if($model->start_day != null) {?>
            <tr>
                <td class="titleInput">
                    <?php echo "Hạn ngày"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->limit_date;?>
                </td>
            </tr>
            <?php } ?>
            <tr>
                <td class="titleInput">
                    <?php echo "Số người học"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->person_number;?>
                </td>
            </tr>
            <tr>
                <td class="titleInput">
                    TKB
                </td>
                <td class="dataInput">
                    <table>
                        <tr>
                            <td>

                            </td>
                            <td>
                                T2
                            </td>
                            <td>
                                T3
                            </td>
                            <td>
                                T4
                            </td>
                            <td>
                                T5
                            </td>
                            <td>
                                T6
                            </td>
                            <td>
                                T7
                            </td>
                            <td>
                                CN
                            </td>
                        </tr>
                        <tr>
                            <td>
                               Sáng
                            </td>
                            <td>
                                <?php echo $model->date1 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time1 != "") { echo '<div style="color: red">'.$model->time1.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date2 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time2 != "") { echo '<div style="color: red">'.$model->time2.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date3 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time3 != "") { echo '<div style="color: red">'.$model->time3.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date4 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time4 != "") { echo '<div style="color: red">'.$model->time4.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date5 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time5 != "") { echo '<div style="color: red">'.$model->time5.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date6 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time6 != "") { echo '<div style="color: red">'.$model->time6.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date7 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time7 != "") { echo '<div style="color: red">'.$model->time1.'</div>';} ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               Chiều
                            </td>
                            <td>
                                <?php echo $model->date8 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time8 != "") { echo '<div style="color: red">'.$model->time8.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date9 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time9 != "") { echo '<div style="color: red">'.$model->time9.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date10 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time10 != "") { echo '<div style="color: red">'.$model->time10.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date11 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time11 != "") { echo '<div style="color: red">'.$model->time11.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date12 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time12 != "") { echo '<div style="color: red">'.$model->time12.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date13 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time13 != "") { echo '<div style="color: red">'.$model->time13.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date14 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time14 != "") { echo '<div style="color: red">'.$model->time14.'</div>';} ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               Tối
                            </td>
                            <td>
                                <?php echo $model->date15 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time15 != "") { echo '<div style="color: red">'.$model->time15.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date16 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time16 != "") { echo '<div style="color: red">'.$model->time16.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date17 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time17 != "") { echo '<div style="color: red">'.$model->time17.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date18 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time18 != "") { echo '<div style="color: red">'.$model->time18.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date19 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time19 != "") { echo '<div style="color: red">'.$model->time19.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date20 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time20 != "") { echo '<div style="color: red">'.$model->time20.'</div>';} ?>
                            </td>
                            <td>
                                <?php echo $model->date21 == 1 ? '<div style="color: red">X</div>' : 'O';?><br>
                                <?php if ($model->time21 != "") { echo '<div style="color: red">'.$model->time21.'</div>';} ?>
                            </td>
                        </tr>
                    </table>
            </td>
      </tr>
      
      <?php if($model->other_request != '') {?>
            <tr>
                <td class="titleInput">
                    <?php echo "Yêu cầu khác"; ?>
                </td>
                <td class="dataInput">
                    <?php echo $model->other_request; ?>
                </td>
            </tr>
       <?php } ?>
       </table>
    </fieldset>
